// +----------------------------------------------------------------------
// | ThinkJS -- Think MVC Javascript Framework                                                           
// +----------------------------------------------------------------------
// | Copyright (c) 2008 http://thinkphp.cn All rights reserved.      
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>                                  
// +----------------------------------------------------------------------
// $Id$

// 核心基础类库

function isAlien(a) {   
  return isObject(a) && typeof a.constructor != 'function';   
}    
  
function isArray(a) {   
  return isObject(a) && a.constructor == Array;   
}   
  
function isBoolean(a) {   
  return typeof a == 'boolean';   
}   
  
function isEmpty(o) {   
  var i, v;   
  if (isObject(o)) {   
    for (i in o) {   
      v = o[i];   
      if (isUndefined(v) && isFunction(v)) {   
        return false;   
      }   
    }   
  }   
  return true;   
}   
  
function isFunction(a) {   
  return typeof a == 'function';   
}   
  
function isNull(a) {   
  return typeof a == 'object' && !a;   
}   
  
function isNumber(a) {   
  return typeof a == 'number' && isFinite(a);   
}   
  
function isObject(a) {   
  return (a && typeof a == 'object') || isFunction(a);   
}   
  
function isString(a) {   
  return typeof a == 'string';   
}   
  
function isUndefined(a) {   
  return typeof a == 'undefined';   
}  
